<?php

include dirname(__FILE__) . DIRECTORY_SEPARATOR . "wayangpay" . DIRECTORY_SEPARATOR . "WaYangPay.class.php";

//require_once(dirname(__FILE__) . DIRECTORY_SEPARATOR . "paypal" . DIRECTORY_SEPARATOR . "payment" . DIRECTORY_SEPARATOR . "common.php");

class wayangpay
{

    private $config;

    /**
     *    支付入口
     **/

    public function config($config = null)
    {
        $this->config = $config;
    }

    public function send_pay()
    {
        $config = $this->config;
        $mobilePhone = "15555555555";
        /* 获取提交的订单号 */
        $orderNo = $config['code'];
        /* 获取提交的商品名称 */
        $goodsInfo = $config['title'];
        /* 获取提交的商品Price */
        $amount = $config['money'];
        $callbackUrl = $config['NotifyUrl'];
        $notifyUrl = $config['ReturnUrl'];
        $pay = new WaYangPay();
        $res = $pay->creatOrder($mobilePhone, $amount, $goodsInfo, $orderNo, $callbackUrl, $notifyUrl);
//        header("Location: {$approvalUrl}");
        die();
    }

}

?>